package com.ghck.server.model.response;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.collections4.CollectionUtils;

import com.ghck.server.model.RegionDict;

public class RegionDictRes extends RegionDict {
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private List<RegionDictRes> children;

	public List<RegionDictRes> getChildren() {
		return children;
	}

	public void setChildren(List<RegionDictRes> children) {
		this.children = children;
	}
	
	public void addChildren(RegionDictRes regionDict){
		if(children==null){
			children = new ArrayList<>();
		}
		children.add(regionDict);
	}
	
	@Override
	public void dealWith() {
		super.dealWith();
		if (CollectionUtils.isNotEmpty(children)) {
			java.util.Collections.sort(children);
		}
		
	}
}
